package com.winning.platwebservice.service.Impl;

import com.winning.platwebservice.dao.DataProcessingDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * @Author: xkh@winning.com.cn
 * @Desc: TODO
 * @Date: 2019-03-08 15:18
 **/
@Service
@Transactional
public class KafkaServiceImpl {
    @Autowired
    DataProcessingDao receiveDao;

    public void processUpdate(Object object) {
        Map source = (Map) object;
        String tableNmae = (String) source.get("tableNmae");
        Map primaryKey = (Map) source.get("primaryKey");
        Map data = (Map) source.get("data");

        receiveDao.deleteData(tableNmae, primaryKey);
        receiveDao.insertORupdate(tableNmae, data);
    }
}
